home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8272 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: No struct in C++!!?
  5. Date: 16 Feb 1996 11:21:41 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4g1pc5$lsg@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe4.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Feb 14, 1996 15:16:18 in article <No struct in C++!!?>,
  15. 'gbw@harrier.am.qub.ac.uk (Georg Woste)' wrote: 
  16.  
  17.  
  18. >Hi, 
  19. >a beginners question: I found in different C++ books examples of C++
  20. programms 
  21. >which contain type declarations and definitions in the main() programm -
  22. for 
  23. >example a struct  - as in C. 
  24. >My question is, whether this is a contradiction  
  25. >to the paradigm of C++. Shouldn't be everything in a C++ programm 
  26. >either classes, objects or the interaction between objects? 
  27. >So is it bad C++ style, to use functions or data outside from 
  28. >classes (objects)? 
  29. No.  One of the advantages of C++ is that it doesn't force you into 
  30. using any paradigm just for the sake of it.  C structures are 
  31. perfectly acceptable when they fit the need. 
  32.  
  33. BTW, in C++ the only difference between structures and classes 
  34. is their default accessibility of members -- public for struct's 
  35. and private for classes. 
  36.  
  37. -- 
  38. Pete Grant 
  39. Kalevi, Inc. 
  40. Software Engineering & development
  41.